]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
shell/app: Only release window ref when we are done
authorFlorian Müllner <fmuellner@gnome.org>
Sat, 13 Mar 2021 23:10:56 +0000 (00:10 +0100)
committerMarge Bot <marge-bot@gnome.org>
Sun, 14 Mar 2021 20:36:41 +0000 (20:36 +0000)
We hold a reference to all windows we track for the app. While that
reference is unlikely to be the last remaining one, we still shouldn't
release it until we are done with the window.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1761>

src/shell-app.c

index 17b179cbab308d1f97f91b2c3e2309553bf1738e..d4fe30b0f5cfa93479dbad1777aa3b837ef4b032 100644 (file)
@@ -1115,13 +1115,14 @@ _shell_app_remove_window (ShellApp   *app,
   g_signal_handlers_disconnect_by_func (window, G_CALLBACK(shell_app_on_unmanaged), app);
   g_signal_handlers_disconnect_by_func (window, G_CALLBACK(shell_app_on_user_time_changed), app);
   g_signal_handlers_disconnect_by_func (window, G_CALLBACK(shell_app_on_skip_taskbar_changed), app);
-  g_object_unref (window);
   app->running_state->windows = g_slist_remove (app->running_state->windows, window);
 
   if (!meta_window_is_skip_taskbar (window))
     app->running_state->interesting_windows--;
   shell_app_sync_running_state (app);
 
+  g_object_unref (window);
+
   if (app->running_state->windows == NULL)
     g_clear_pointer (&app->running_state, unref_running_state);